You're absolutely correct and your suggested implementation is much better. Will fix.