cleaned up min/max calcs. Fixed patch bug where AddContext return val wasn't being caught. And another patch bug.