Small sql fix, build script added