Redid window code: now only errors when hitting the edge of the loop. Also: fixed migrating tag issue by changing the values written to DB