Add some static casts to avoid C++11 errors in initializer lists.
Add missing #includes.
Adjust expected error rates for MacOS.