Fixed more degeneracy based bugs, tracked memory better in the GPU