Removed getchar null check