Fixed timeout bug in message pump.