Fixed error handling for ReferenceErrors.
Release 0.2.23