Small bug fixes.
Another small template fix.