Fix type compatibility/prototyping bugs.