fix minor bugs that made tests fail.