Fixed crash when using state setters.