Template bugs fixed.