Core pr 6

This also contains PR5, which have not been closed yet.

Else only minor changes from last review.