Fix Andy's horrible bug
Merge pull request #758 from Metaswitch/andys_bug

[Reviewer: AMC] Fix Andy's horrible bug