Fixed misc bug