Address @cmars comments

* build errors as type error
* fix wrong logic in HTTP listener startup