Fixed initialization bug for fragments