Fixed issue when removing all related models from a N-M relationship