Optimized and added more targets.
Added getcwd call.