Address sanitizer, some memory bug fixes and ff_file development.