only sum when value exists; properly filter entities with undefined values, fix #121
check if bounds are valid before using
Merge branch 'feature/fix-121' into develop