Added arbitrary mode into dictionary generation.
Fixed mode property.
Fix thrift conversion.