fix OOIION-1099

In fact, with slightly simpler code.