Added option to turn off autocasting