This function should work and is in use on a large number of sites. Please ensure that you have specified the zone in your ad tag or WordPress Widget. These cookbook recipes should help: https://www.adplugg.com/support/cookbook/ad-zones
The max ad count function doesn't seem to work. I've added three ads, want to show two, still shows three.