More improvements on smartclose
Improve F-keys buffer operations