Added examples to buildfile
Added additional casts to fix javac compiler errors