Fixed exception handling to be sane and guide developers towards the source of exception.