Filter out CR as it can break saving/restoring settings from a file
Reduce maximum key field to 2999 chars to match the global 3000 limit for an nvram value