Added extra calculation for the little icon in the toolbar of popups. Fixes #97