Fixes several fixed-point overflows in the PLC code