Bugfixes to pomagma main