Modified code to work against properties with undefined values Issue #16