Fixed misc issues