Snicolas/issue 215

Should be merged ASAP
seems like there's some overlap with this PR and the PR for 213