Some intermediate changes for allowing the application to run under a subdirectory.