Fixes for compile time errors on C++11

Most of the errors are implicit casting which are not allowed anymore.