Fixed a bug in wrapper