Improved error handling, and added overloads to get (or throw) the final value.