added own version of optString/optInt to deal with null (instead of not
existing) values