Improved SQL and python handling of projects without files