Fix logic when sgp.percentiles.baseline should be NULL
Edits to getPanelData and related code for SQLite usage.