Fixed some focus behavior bugs