Merge pull request #413 from norv/fixes

Oops.
! increment the task id for the added scheduled tasks

Signed-off-by: Spuds <spuds@spudsdesign.com>
! error / actions counts were moved to a sprintf
! remove extra spaces

Signed-off-by: Spuds <spuds@spudsdesign.com>
! code formatting ... spacing etc
! not sure about that $$ variable ... plus some spacing, lots of unused globals still

Signed-off-by: Spuds <spuds@spudsdesign.com>
Merge pull request #418 from Spuds/MergeErrors

Some fixes due to me not rebasing my branches
Merge pull request #416 from norv/fixes

Fixes
Merge pull request #420 from norv/fixes

Fix escape_ methods
Fix upgrade script after db layer updates.

Signed-off-by: Norv <a.w.norv@gmail.com>
Small fixes for upgrade script.

Signed-off-by: Norv <a.w.norv@gmail.com>