fix type of return value of extra_options as it was before, enhance unit tests