Improve error message for undefined struct