fixed some overoptimizations which prevent compilation in non-unity mode