Simplified structures and fixed warnings.