Fixed sql scripts