carving: fix #307