Fixes for new django version