Fix typo and state that any change to a different state fires the onstatechange event

Fix #433.