It looks like you are on the right track, at least with the intuition of what you should be doing. It is a little difficult to tell what may be going wrong without seeing your code though. If you wanted to post it here, I would be happy to check it out.
In order to debug, I would suggest starting with a simple network and problem where you can easily see the neural network weights, and interpret what they should mean. That way, when you perform an update to the network, you can check to see that the weights are indeed changing in the direction you want them to.
Hope that is helpful.