Fixing inlineform bugs, updating sql code.