minor improvement for scala support