Fix unbndfun sum

This is to resolve #920. All tests passed.