Fixed some bugs in DAO.stg and PkStatementSetter.stg. refs #500