Added SQL support, kind of and small changes