Workaround for Segfault when compiling with -g flag