Error messages, and minor changes