Check returns.
a bunch of fixes, fixing issues with logs being dropped when a function
is called concurrently