Fixed sorting and selection of database icons (issue #118)