Fix various little bugs