Fix 578

Resolves #578 and should fix failures introduced in #628 (worth checking this passes on jenkins before merging)