Security, redundancy fixes