Merge pull request #399 from carlosmn/free-null Add checks for NULL to the config and remote free functions