Fixed spme bugs.