Improved include function - better error handling.