Bug fix in sqliteSGP