Fixed initialization error checking