Fix for annoying ValueError exception messages