Added an error message when requiring a platform that cannot be found.
Made gotoSubDir a bit less hardcoded.

It would otherwise have trouble in some cases on some platforms.