Fix wrong order of linear enumeration