Added test. Improved error message.