NameError handling, fixed copy doc used in amend, handle tabs