Improvements to the logPunishment method. It's now more loose. Also
improved the tests.