Improved safety of dll ejection, small fix in OnTabPressed