Added some tests for consume.

Also fixed a bug in consume. Coincidence? Perhaps.
PEP8 cleanup.