JS bug fix in the type checker