Other than simple experience leading to reading code better, I suggest attaching a debugger to the application, add some break points, and analyze data as it goes through the system. That way you KNOW what is going on, instead of presuming (by logic or any other means) what is going on.