django bug fixes
optimizations