Fixing compile time errors for C++11 which allow only explicit casts