Fixing a few dumb bugs