Fixed code so it actually builds.

The program was trying to break out of a function which wasn't possible.