Cast fix and include fixes