Fix deprecation warning for DB query and fix task counting
Merge pull request #27 from trev/fix-buildtask

Fix deprecation warning for DB query and fix task counting