The whole block of checks about `mutation` is too complicated (if not buggy).
Please simplify this by:

1. removing try/except and using only ifs
2. doing all checks in one place