Made several fixes to tests from @bmispelon