Obviate empty array bug