Clean up generics in FFI.

--HG--
extra : amend_source : 50b636023011e02cfabe67c3b15be8c5363e526e