Fixing a confusion of type in templatetags