Fixed a few things so that it now compiles