Fix bugs with libuv integration