Adds django 1.6 compatibility.
Couple of cosmetics fixes.