fixed a few stupid bugs