Fix layer-wise recosntruction error
Merge branch 'master' into fixlayers