Fixed small bug with user path, and cleaned up code a bit.

When opening from dir '~/', default would become '~/.'
due to way relpath works in python.