Added auto-tagging on layer add
Fixed tag sanitization method