Fixed some pointer issues.

Direct references to structs have been deprecated, and generates a lot of
warnings. This fixes some of the problems, but I'm sure there are plenty
more.