Fixes #1685

If the registry keys do not exist, appropriate registry keys will be created now.