Fixed misc problems