Fix problem with tests running in wrong order

OTP-9881