Fix mark_error in check_data