Issue 346

closes #346  thanks @martinszy @melizeche.