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