fixed #337

improved auto indentation for some cases