Bug Fixes

Fixed multiple bugs in the wrapper.