Fix code inconsistencies in tests