Taxonomy Rewrite Rules Redirecting Instead of Masking

Found the solution. The rewrites were getting added to the db after the system was reading them from the db. Moved the code and it worked!