Fixed encapsulation problems, and some other things like name capitalization.