Fixes for #3

- Add back assert to minimize differences from upstream
- Use 'pk' instead of 'id' for filter in case UserModel doesn't have an
id field