Much debugging of MAF to DB script