Using assert handler instead of throwing an exception in a few error cases (e.g. out of bounds access)