work around numpy crash with size 0 arrays