Fix #1284
(cherry picked from commit b5e6f80a013039ab59de44f67393e2b39bb02060)
Fix #1284 (2)
(cherry picked from commit 4baad63f6efcf206f72d65fdab3dd5329a5b33ab)

Conflicts:
	ext/tag.c