Adds to task.rb. Fixes some bugs.