Remove unnecessary module open
Add more cflags warnings, and fix a warning