Converted asserts into exceptions