Fixed merit function bug in scpgen