Fixed null pointer exception and properly remove the poller from the map of active ones after it finished its work.