Fix explanation key and prior_rating type decoding
Fix typo with return instead of raise
Add None check while applying modifiers
Fix typo and some PEP8