Fix missing delete after the protocol has been constructed

If proto is not deleted a duplicate protocol is added and causes a syntax error. There was also a PEP8 indentation warning.