Logical bug fix in method penalty_if?
Minor bug fixes and styling changes