Fix unused parameter warnings
Move flags to toplevel, add warning flags