Applied IM 1.2.1 fix by hand. https://github.com/intermine/intermine/commit/3902ca0e930ccb15fc66e3056923b46c131e91c9