Started fixing bugs