Fix bug where an empty keyword is added to a task
Add unit test for bug