Fixes #238, realdirpath not working.