Made type coercion more explicit and efficient