Finish casts to compile without -fpermissive