Key storing/loading bug fix and focus change after connection