Flexible type checking