Bugfixes and misc improvements.
The bugs can be reproduced by trying to add a relationtype, then
adding a relation between 2 entities, like with menu options
6, 4, a.