More fixes that makes the class actually work.