Fixed both the inability to close alerts and added state invalidiation.
Fixes #31 and fixes #34