Fix overlap of output and input
Merge branch 'fix-overlap'