Fix exceptions on error pages

Fixes some minor errors that prevented the error pages from working correctly.

closes #6 and #4