patch from Charles Shapiro <cshapiro@numethods.com> to fix column ordering