Fixed bugs that caused crashes due to no selected control box