Fixed ugly code in CRUD, and fixes #21