Changed error messages so that I can see from what file the bug originates