Correct errors from differening behaviour between 3.0 and 3.1