Reduce warnings about conversions
Fix some warnings and add test.js