Fixing C mistakes