Many fixes for parameter passing in pool module