Perform realpath before various checks, not after