Fix all listen stuff, add tests