Clean up imports and add expanduser() calls