Now, if you would like to know what was the cause:
It was a matter of floating number imprecisions (basically sometimes 2 - 1 did not equal exactly 1) that caused the Greatest Common Divisor algorithm to go in a nearly infinite loop (or more accurately: recursion), freezing the game during loading.