Fix CUP behavior with origin mode
HPA respects origin mode and L/R margins
Merge branch 'develop'