Yes, it’s because of the 12. If your mapping is in [1, 12], just subtract 1 and it should work.
That’s strange, since it shouldn’t work.
Could you try to remove the freezing part and check if again?
It would be interesting to know, if it was ignored somehow.