Some cleanup and add 1ms timeout in one event..