add helper to convert array to tuple
 fix bug in case of empty tuple
 fix bug in case of empty tuple
 fix bug in case of empty tuple