Merge upstream changes: bug fixes, webstorage support