Added precheck on data items/types

Fixes http://manage.dimagi.com/default.asp?67007#381789 (exception on main site).