Fixed bugs in todo.js