Fix typechecker bug so that main :: a main = error "Urk" gives a sensible error message rather than crashing the compiler