Fix typos
Replace make by var
Fix unsafe array indexing