small robustness fix in wrapper