Fixed offscreen positioning of elements

Fixes issue #5