I think you used > instead of >= for the price calculations because you can't buy something if you have the amount it costs.
I've never encountered this problem as far as I know. But I think I've already fixed it for the upcoming update.