Hopefully fixed major errors when running the application.