Swapped out realpath in favour of using getcwd().