Minor cleanup and renaming
Fixed bug with loop directive