fix test errors caused by last commit
fixed a bug introduced in a previous commit that wasn't covered by unittests, but was covered by examples.