Workaround jQuery bug (val() returns null sometimes in Chrome).