Fix slowness caused by using exceptions for control flow

<3