Added some type checking for operators