Fix frame handling