cleanup and bug fixes for ContentProvider CRUD