Improved Type Checking

Type checking now returns a more descriptive error.