Fixes "Cannot remove an observer for the key path `endOfInput`" crash