added tests, fixed crash when numberOfFieldsInSection is called for empty form