Fixed some problems on Django template tags