[FIX] Added case of line with only spaces and corrected code