Added some parameter locking to fix glitching