Fix checking for non-empty folders in initcommand