Product total and Shipping totals Tax not correct.

Have two items these have 15% tax included
Item 1 sell price $2.50 tax $0.33
Item 2 sell price $23.00 tax $3.00
Shipping sell price $5.00 tax $0.65

Total sell price = $30.50
Total tax = $3.98.

Setup 1
I have Store set up as follows:
Country Tax GST = 15%
Apply Tax to Shipping YES
Flat Rate In Country = $5.00 – $0.65 = $4.35

At checkout
Item total = $25.50 this is correct
Shipping = $5.00 this is correct
GST = $3.83 this is not correct
Cart Total = $29.85 this is not correct.

Setup 2
I have Store set up as follows:
Country Tax GST = 15%
Apply Tax to Shipping NO
Flat Rate In Country = $5.00

At checkout
Item total = $25.50 this is correct
Shipping = $5.00 this is correct
GST = $3.83 this is not correct
Cart Total = $30.50 this is correct.

Seems to be be a basic calculation problem.