Added timeout to the blocking queries and fixed an internal buffer bug