Code cleaning.
Updated cache handling for Dj 1.7 #376