fix bug returning default value for zero length elements
Merge remote-tracking branch 'upstream/master'
Merge branch 'master' into portable