Fixed some issue related to keyboard management