BUGFIX: wrong operator
BUGFIX: potential out of bounds
fixed uninitialized variable
adding some sanity check according to visual studio 2013 static code analysis
Merge pull request #1 from MADEAPPS/master

merge in a few updates from the newton-dynamics master