Change NSAssert to exception raise

This ensures that the assertion will always fire, even in builds where assertions are blocked.