Fixed handling nil and empty value.