Submit button fixes. Close #369 and Close #367.