Fix fgets warnings

This fixes warnings observed in #12