various fixes, including taking into account non-breakable blocks for #1501