fix the bugs that chris mentioned