Use fgets instead of scanf - Fixes #2