Improve error reporting, add a few annotations.