Issue 233

This fixes #232 and #233