Use Platform.exit() to terminate properly.