Fixed offset error for bg and wnd