Added option to hide tool duplicates

As suggested by JaKe
Fixed gates that return nil returning 0 instead of their type's zero value

Fixes #674