Fixed bug when passing an empty array