Don't filter by app_id if it's null

http://manage.dimagi.com/default.asp?131005
@dannyroberts fyi.