Wrote a test for $state.contains and fixed it.