Added warning flags (and fixed errors that arose)