fixed some stupid bugs.