v2: fixed most of the build issues