Fixes for compile time errors on C++11

Most of the errors are implicit casting which are not allowed anymore.
Does this compile?  I don't have a c++11 set up running at the moment ...