Fixed some stupid bugs in the compensation code