Various small fixes and preparations for whitelisting capabilities