Version 0.3.1

First tested release. A lot of small fixes and patches