Fixed issues with location purpose checking.