fixed some scala API issues
fixed scala API issues