Work around SQLite bug; Avoid Matrix class (Issue #521)