fixed fatal error in beforeValidate, fixes #28. fixed fatal errors from getting settings object incorrectly, fixes #29