You could change the pins, it would show whether its a software issue if you did that, if the problem followed the pins then its software, if not then hardware. I am off for some sleep (12:30 here ) so hopefully you will get some help from someone else if you cant find the issue.
Hood.