Fixed potential memory leak in FileLoader.
Removed unnecessary pointer conversion.
Uhm, there sneaked various nullptrs into SQL queries...
Updated TODO.