fixed a couple of silly bugs