Small changes. Added scala support.