JavaScript corrections for edit screen