Update code to working copy from Bastli-NAS.