Some TODOs and a few portability changes with scanf