Fixed bug #39 with better backup scheme.