Fix DB offset method. Can not be negative.
Use max() instead of ternary in DB offset.
Merge pull request #3017 from KaneCohen/db-offset

Fix DB offset method. Can not be negative.