It's interesting that you also were doing Project Euler, though yours was on problem 18 and mine on 22. :) And it's also interesting that my solution to 18 didn't trigger the bug, even though I laid out my triangles nearly identically to you.