Fix unix/windows issues and file permissions.