Fix #44

Adds test and fix for #44