Fixing some bug that happened when we refactored the JS Wrapper.