A couple of small changes

A couple of changes discussed with Mikko and Jeremias, and two minor changes to fix the tests and demo. See commit messages for descriptions.