Fixed bug with mismatch penalty