Fix off-by-one error in mode event
Fix typo in luna_corelib