Improved type checking of parameters