Trying to fix a few small bugs