Fixed raj bug in df (thanks Miklos) and added ramax to scaling