Fixed some invalid read/write issues. Still 1 with the quit button

Signed-off-by: Lasconik <caillouxnicolas@gmail.com>