Improved modal positioning