Bugfixes for class portfolio