Lots of hacking to at least allow the app to compile