When you can't find a bug, use binary search:
Comment out half your code
If bug disappears, it's in the commented half
Uncomment and comment the other half of that section
Repeat until you find the exact line
This finds bugs in logarithmic time, much faster than checking line by line.