Added safety check when determining if a value is a (product) object or an (product ID) int (fixed #1)