Fixes for custom user models support