Remove unnecessary locations array.
Use Framework Class when available.
Fix a syntax error.