Added a timeout value to the wait method.
Added a call to poll() within the stop method, to make sure Repose gets stopped after the timeout period.