Improve delete assignment functionality and fix bugs