Fixed a bug with permissions when compiling.

- Fixed a case where the compiler would throw an error if it fails to
write to the output directory due to permissions.