This patch required a trivial rebase after conflicting with bfcf1b3480 so I'veattached a v2 to get the CFBot to run this.
--Daniel Gustafsson