Added support for correct directory-names when using ../ and ./. Cleaned up the variabel-scope of target (by adding lastTarget). Fixed license in source file.