Dev

Fix and unit tests for #254