Merged from HEAD: Changed specialization of encode_integral for bool to work around issues with the sun compiler