Tidy up logic for if an error should be asserted or not