Fixed code for getting the base path.