FIxing a few small bugs