Fixed various little bugs