Keys getting "stuck" problem

Hey everyone!
I have been using GE for years and always noticed this bug, but as in my current game it really affects gameplay, decided to ask about it.
The problem is this - I have left and right arrow keys set to walking left and right and space to fire. But what sometimes happens is that although, say, left key is already unpressed, the game thinks the key is still pressed and the player will keep on going left until I pres left key again. It is as if the game misses some of the events or doesn't read the keys correctly.
The code seems to be clean, I have both key down and key up events, where I specifically on key up set flags to not move anymore. But this happens anyway. This happens relatively often and has always happened to me in GE. I just want to know if I can do something to fix it or if it is a known problem. Forum search revealed nothing.
I have been using GE for years and always noticed this bug, but as in my current game it really affects gameplay, decided to ask about it.
The problem is this - I have left and right arrow keys set to walking left and right and space to fire. But what sometimes happens is that although, say, left key is already unpressed, the game thinks the key is still pressed and the player will keep on going left until I pres left key again. It is as if the game misses some of the events or doesn't read the keys correctly.
The code seems to be clean, I have both key down and key up events, where I specifically on key up set flags to not move anymore. But this happens anyway. This happens relatively often and has always happened to me in GE. I just want to know if I can do something to fix it or if it is a known problem. Forum search revealed nothing.