loads of fixes