Rewrote the function getRealPath and tests for it.