Small tweaks to make this class work.