Fixed merge problem
Reapplied fix from 284ee76 that was incorrectly lost in merge