More defensive coding in form-plugin