#7 streamlining of exception throwing, new exception classes, few style
corrections, corretion of a couple of logic errors