Fixed bug with first null element