merge support for pyramid refinement and other fixes