Removed unneeded boxing/unboxing and some other redundancies. Other minor language improvements.