Fixed #5621 and slightly simplified symboldatabase code.