Fixed issue with realpath() calls