Handle and test coercion of optional types properly
Fix docstring