Feature/issue 555 fix

Hopefully should close #555.