Addes tests and safety checks for TagsHandler.