Fix quite a few things