fixed minor stuff

- fixed assert for last state
- improved selftest