Fixed protection and bound calculations
Merge pull request #2 from DonoA/master

Fixed protection and bound calculations