Fixed wrapper functions, small bugs