Better error handling for bar initialization.