Bugfix optional data elements

The data object has elements for number of views (for instance) that
can be null. Do not call getInt on those, as null is not an int.