Fixed issues around setting state on unmounted components