Corrected the casts, and also get rid of the -beta part.