Fixed that getchar() wasn't actually called, and that loops might not even execute once