Only set contain_headers if not nil, otherwise set to 1

Fixes bug since nil.to_i is 0