fixed a couple bugs.