Fix trivial bugs