Properly validate folder ID (fixes #156).