fix #13: javac bug in index-set
also do implicit type conversion only when #valueOf method exists