Fix some of the warnings and notices we are getting when rendering

Fixes #