Fixing various little bugs