Fixed some regression bugs and failing specs.