Fix empty array bug, add option type support