Use NVM_ prefix for variables

Updated some string comparison to be strict POSIX compliant