Fix incorrect method of making files relative.

This broke the multiple subdirectory functionality, since the subdir
paths would always be incorrect.