Position bug

Modified calculation for window positioning.