More security fixes:
* completely fixed capabilities
* partially fixed license and certificate packet processing
* adding missing checks for BER