Hopefully fixed a load of stuff (may break)