Finally resolved problem with program arbitrarily crashing. This was caused from overlaying an integer and pointer and forgeting to check the boolean that denotes both.