Should fix #60 also adds tests to replicate the issue and avoid regressions