Fixing a few tiny bugs here and there