Some OMX clean-ups and another attempt to improve the teardown sequence.