Fixed some bugs and updated version

Fixed broken tests and some other issues.