Explicit casts for C++11 standards compliance