Fix a bug in the automated migration process. Under some undefined circumstances (reproduced on Debian wit Ruby ruby 1.9.2p136 but not on Mac OS 10.8 Ruby 1.9.3p194), administrator would be kicked out of the application because the sort_by{} would get confused where a sort is enough. Tested on both environments