Fixed several bugs and improved debugging messages.
0.9.2