Banking question

I have a question for you guys. I bank at NBT bank in New York. Last Thursday I deposited a check and it cleared yesterday. My bank puts in debits before it puts in credits. So, the charges that hit my account were put in first, and then the check was entered last. Because of them doing it that way, I went negative 1.48. The next thing to hit my account of the cleared check, on the same day, putting me back into the positive. So, they hit my account with not only one NSF fee, but two (doesn't make sense).

So, my question here is, should I have been hit with a NSF fee when the check cleared the same day as the charges?

P.S. I am not longer depositing checks, I am going to cash then deposit *lol*.