fix the most obvious bugs