Fixes misc bug