Consistently clean up after .ready() handler, close gh-1135.