Fix serialize method to serialize falsy type properties