Fixing remaining errors as far as I can see