Fix menu overlap

Fixes the following bug: http://www.joduska.me/forum/tracker/issue-152-menus-overlap-shared-memory-bug/