fixes loads of stuff