Added callback in backup and restore to let to external part of code to execute something inside locking
Minor: fixed typo
Fixed getVariable() with default value