Fixes two common javascript errors.