Improve error messaging