Support general option setting with slightly ugly metaprogramming. Fixed transaction reset and cancellation.