Automated private marking (and some functionality fixes)