Fix #1054 by more selectively pruning empty project array items.

This fixes issue #1054. I basically just added a recursive array_filter() re-implementation that allows '0' values to remain.