Object casting bug in Permission Discovery fixed