Fixed bug with database clearing and tag parsing improvements