Changed registry values to use function.