Assorted improvements

Path handling, formatting, and proper support for modes=4.