Added code to deal with messed up filename sorting