Added copyright field plus minor security fixes