Fixed various bugs in add extra fields js