Damn, you guys are too awesome... I'm learning more these last few days than I did these last few weeks xD
The %5$d stuff I eventually understood the logic, I edited my post, but thanks for validating what I thought was happening
Those alternative fixes are great, my fix was really just temporary anyway, I was testing it and had to do something to just check if the values were fine, was the first thing that came to me xD
But why would my original code not give me any problems on that same variable when I'm not using any kind of fix to make it 0 when nil?!?!