some bug fixes. Possible interrupt handling problem.