a few small fixes, also updated for new version of django