fix trivial bugs