diff --git a/refpolicy/doc/templates/module.html b/refpolicy/doc/templates/module.html
index dbd92a0..23c47fa 100644
--- a/refpolicy/doc/templates/module.html
+++ b/refpolicy/doc/templates/module.html
@@ -2,11 +2,11 @@
 <h1>Layer: [[mod_layer]]</h1><p/>
 <h2>Module: [[mod_name]]</h2><p/>
 [[if interfaces]]
-<a href=#interfaces>Interfaces</a>
-[[end]]
 [[if templates]]
+<a href=#interfaces>Interfaces</a>
 <a href=#templates>Templates</a>
 [[end]]
+[[end]]
 <h3>Description:</h3>
 [[if mod_desc]] 
 [[mod_desc]]