Fix further notices.
Fix issue #552 - Warning thrown in templates.