Fixed a few attribute and initialization bugs.