Allow clang build by disabling exceptions and fix integer overflow