Fix error reporting for invalid object key.