Cleanup on unbind
Fix bugs around internal state data structures

Handle multiple data structures better.