Add UnityLibrary and some fixes