Improved wrapping of types; fix the resulting type of binary boolean expressions