On the first issue, it looks to me like you have your own map function -- scheme_map is not an s7 function. It is passing a null pointer to s7_integer. As s7.html explains (under "FFI notes"), the C-side functions do very little error checking.