Fixes for broken tests following 0eabe2a (bug 878368)

@basta I'm not sure the intention of the original bugfix as I don't have access so please check this meets the requirements of the bug if you're looking at it.