Fix handling of ls-files