added tests for tags persistence.
fixed bug