Fix handling of symlinks and add CHECK_CONTENT.