Added argument validation and coercion.