Fixing bug to enable helpful error reporting.