Fixes for proper state management across multiple uses.