squashed some bugs. now follows spec more closely.