Fixed the segfault on AMD. Needs either -O0 or -O1. Any higher optimisations
will cause a segfault.