Fixup code formatting in EAP-LEAP, and use R*log functions