Fixing mode change and removing old code.