various fixes and cleanup
cursor up/down+ frames protection