Symbol database: improved type handling (fix problems in previous commit). Ticket: #4952