Fix issue #205 and add a basic test