Fixes issue #572

This method was only being called once, so I inlined it.