Trim empty blocks