Fixes some warnings and pragma optimize p is not valid in 2010+
Merge pull request #27 from iojamp/master

Compile warning fixes