ignore empty blocks in calculation, fix padding/linespacing bugs