Version 3.1

Bug fixes. Performance improved.