Fixed a few errors

Will merge these because lot of things are broken anyway.