Fix uninitialized variables, and use -O so gcc starts checking for them