Several bugfixes
0.3.1