Fix listing files method, add system exit statuses with code 1