Dealing with arrays containing nil values gracefully

Signed-off-by: Phan Le <ple@pivotallabs.com>