Some minor improvments to the way errors are reported