fixed a bug in r.sun