Replaced C-style cast with C++-style