trivial bugs fixed