fixed trivial bugs