Fixed bugs from rest_framework update to v3