Fix compiler warnings by removing unused Exception variables