Fixed misc errors