Lots of bug fixes!

closes #23
closes #24

Fixes a couple annoying bugs in the rendering system.