Corrected size of empty result array. Fixes #1603

This fixes #1603. The result array had a wrong size and contained not initialized values, which caused the second error decribed in #1603.