Fix syntax errors in lpi algo