Fixed issue with null values in equals method, fixes #52