Add some runtime tests

These are tests for bugs #21 and #22