Some security and indentation fixes