Fixed directory concatenation issues.

Also removed unused code.