Remove NSE, Template formatting

Change subset statement to [] operator to avoid NSE problems in function
Use 6 spaces instead of tab.