Correctly (hopefully) implemented Fixed-Portion approach, and fixed lots of other bugs