Adapted to new Splout SQL code.