Fixed alpha calculation bug