better handling of NULL
fixed slow output because of null geometries
removed useless array for features