Enhance error handling and its tests.
Add a missing prereq to Scalar::Util.