Fixing bug in wrapper