This adds some example test cases for periphery and fixes a first bug that can be spotted with such tests.