Use os.path.realpath() before os.path.abspath()

Closes #454
Fixes #413
Merge branch 'realpath' into develop