Modified exceptions and asserts

Change-Id: I9d868d6a6581ee07bf046bf49938a4dae74186bc