quite a shitload of fixes