Fix NULL to nullptr for SQL queries take 2