Fix for issue with None values which tried to be casted by _cast_value