JavaScript case correction