Fix state change callback handling by managing all callbacks in one place and using blocks to watch the changes otherwise.