Code clean up and fixed empty except statements