Version 2 update

Many bugfixes.