update counts on delete, closes #489
fix int conversion