1) Fix for NullPointerException on key permissions is empty