Fixed incorrect resizing when in background