Clear refmap when remove posts
Fixes #397