Some fixes related to option setting and tests for some of them.