A few bug fixes handling frames