added missing type casts
added missing quote and quoteName