Throw exception with clear message in case of int and bool as type

I'm always using int and bool instead of integer and boolean on types and then get a very generic exception message, this makes easier to find the problem.