Sorry, but the old navigator has to step in.
It might be that I do not understand the used code but IMHO the used steps are wrong!
N for North would be assigned to courses from above 348,75 over 360 (which is 0 ) to 11,25
NNE from above 11,25 to 33,75 …
The steps are all 22,5 ° wide.