Fixes the position of popup menu

Fixes issue #423