[issue #84] Fix bug of returning arrays in some cases