Many small fixes for tagging