Make operands castable.
Fix type naming errors.
Improve error messaging for invalid operands.