Hopefully fixed segfault by fixing array sizes to actual number of cores