Merged 1.2 changes into 1.3 and added clean up for the directives.