Close dialog on enter key; JSLint fixes