Synced with the JS lib.