Makes sure correct template is used. Fixes a small bug.