Fix bug related to case sensitivity of site codes

http://manage.dimagi.com/default.asp?133792