Fixed a bug in Listen(), added a wrapper for running routines.