Closes #1008.

Fixed some other tests too