a little cleanup + one bug fix