fix OS check in toxic
fix define checks
fix potential memory issue
Merge with upstream
Merge pull request #497 from rose-m/master

Small OS check fix