Fix for issue #1
Also added sample getting, saving, reseting preferences