Fixed incorrect tag setting. Added correct log messages