Fixed misc compilation issues