Added human understandable error messages and fixed some glitches