Fix nonblock issues