had to reduce optimizations even further to fix segfault