fixing up a couple of bugs