Fixed the bug, it was an uninitialized array that was intermittently working.