Fixed some warnings and invalid compiler flags.