Gold ends month slightly higher amid weaker dollar, Greek debt impasse