Rebasing to master

Exception handling in parts.py