Bug fix from Eli and Jonathon