Fixed obvious bugs