Fixing test case, and also fixed log-linear writing