Minimal solution with error handling