Fixed bugs with clicking and building onthe grid