Added automatic system detection based on current directory.