Fix realpath usage