1) removed debugging outputs
2) added type information to fix Java warnings
changed trap splitter to not add empty traps and remove existing ones in order to avoid infinite loops