Tidy up path handling.