ensure that captured blocks in erb and slim templates return nil, fixes #1582