Solved the problem with the indentation, now the autoindent works.