JBPAPP-7824-Patch1

Fixed by correctly decremented counters at proper place and provided integration test to verify the same