fixed a few small bugs