Fix buggy tests