various fixes
make all main()s return int
fix uninitialized variable