Fix handling directories
Fix handling directories

kostiakoval/Natalie,phimage/Natalie,krzyzanowskim/Natalie,a2/Natalie,hartbit/Natalie,alvinvarghese/Natalie,phimage/Natalie,petester42/Natalie,krzyzanowskim/Natalie