Fixes xml header
Catch proper exceptions in python3.4