Small bug fixes.

http://forum.openstreetmap.org/viewtopic.php?pid=369485#p369485
and suncalc