added error handling and fixed up integral conversions, as well as test/example for all types of vector