bugfixes in soft logic potentials; improved gradient checking