Fix numerous tree construction problems by parsing the lsdk key. Fixes #38.