Do not use relative paths for symlinks when the location of the symlink
is within a symlinked path.
Fix custom functions for BSD. Refs #42