Slighlty improved typecasting
Clearer error message.