prevFile.stat is null sometimes

The shortened if statements was hard to follow with this change. So I broke them all out for the moment. They can be refactored back to the sort statements.