Fix #3 and extended protocol