updated casting in a few header files