Added affinity rule location extension
Fix issues with rule parsing