fixed possible problem with realpath and false value

realpath(false) = current working directory.
This can cause problems with getAlias() which returns false.

fixes #3113