Fix bug that exits main loop too quickly.

Caused by indention problem.