C0103 fixes 1

this part contains the changes on local variables
pinging @hoffmabc: This is not the proper way to chain exceptions. Also, raising strings as exceptions is generally considered somewhat vintage style.